/*使用映射(map)建立阿拉伯数字0~9和
英文单词zero到nine的映射关系，
并输入阿拉伯数字(如1)，输出英文数字(如one)。*/
#include <iostream>
using namespace std;
#include <map>
#include <string>

int main(int argc,char **argv)
{
    map<int,string> a;
    pair<int,string> p1(1,"one");
    pair<int,string> p2(2,"two");
    pair<int,string> p3(3,"three");
    pair<int,string> p4(4,"four");
    pair<int,string> p5(5,"five");
    pair<int,string> p6(6,"six");
    pair<int,string> p7(7,"seven");
    pair<int,string> p8(8,"eight");
    pair<int,string> p9(9,"nine");

    a.insert(p1);
    a.insert(p2);
    a.insert(p3);
    a.insert(p4);
    a.insert(p5);
    a.insert(p6);
    a.insert(p7);
    a.insert(p8);
    a.insert(p9);

    int b;
    cout<<"please input number:";
    cin>>b;

    for(map<int,string>::iterator it = a.begin(); it != a.end(); it++)
    {
		if(it->first == b)
        {
            cout<<"English:"<<it->second<<endl;
        }
	}
    return 0;
}